package com.homeparking.manage.service.impl;

import java.util.List;
import com.homeparking.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.homeparking.manage.mapper.ManageParkingMapper;
import com.homeparking.manage.domain.ManageParking;
import com.homeparking.manage.domain.OutManageParking;
import com.homeparking.manage.service.IManageParkingService;

/**
 * 车位管理Service业务层处理
 * 
 * @author liuyangyang
 * @date 2025-10-16
 */
@Service
public class ManageParkingServiceImpl implements IManageParkingService 
{
    @Autowired
    private ManageParkingMapper manageParkingMapper;

    /**
     * 查询车位管理
     * 
     * @param parkingId 车位管理主键
     * @return 车位管理
     */
    @Override
    public ManageParking selectManageParkingByParkingId(Long parkingId)
    {
        return manageParkingMapper.selectManageParkingByParkingId(parkingId);
    }


    /**
     * 查询车位管理列表公共
     *
     * @param outManageParking 车位管理
     * @return 车位管理
     */
    @Override
    public List<OutManageParking> selectManageParkingListCommon(OutManageParking outManageParking)
    {
        return manageParkingMapper.selectManageParkingListCommon(outManageParking);
    }

    /**
     * 查询车位管理列表
     * 
     * @param manageParking 车位管理
     * @return 车位管理
     */
    @Override
    public List<ManageParking> selectManageParkingList(ManageParking manageParking)
    {
        return manageParkingMapper.selectManageParkingList(manageParking);
    }

    /**
     * 新增车位管理
     * 
     * @param manageParking 车位管理
     * @return 结果
     */
    @Override
    public int insertManageParking(ManageParking manageParking)
    {
        manageParking.setCreateTime(DateUtils.getNowDate());
        return manageParkingMapper.insertManageParking(manageParking);
    }

    /**
     * 修改车位管理
     * 
     * @param manageParking 车位管理
     * @return 结果
     */
    @Override
    public int updateManageParking(ManageParking manageParking)
    {
        manageParking.setUpdateTime(DateUtils.getNowDate());
        return manageParkingMapper.updateManageParking(manageParking);
    }

    /**
     * 批量删除车位管理
     * 
     * @param parkingIds 需要删除的车位管理主键
     * @return 结果
     */
    @Override
    public int deleteManageParkingByParkingIds(Long[] parkingIds)
    {
        return manageParkingMapper.deleteManageParkingByParkingIds(parkingIds);
    }

    /**
     * 删除车位管理信息
     * 
     * @param parkingId 车位管理主键
     * @return 结果
     */
    @Override
    public int deleteManageParkingByParkingId(Long parkingId)
    {
        return manageParkingMapper.deleteManageParkingByParkingId(parkingId);
    }
}
